<?php
return array(
	'attributeLabels'=>array(
		'id' => 'ID',
		'rePassword' => '确定密码',
		'verifyCode' => '验证码'
	),
	
	'rules'=>array(
		array('verify, rePassword', 'safe'),
		array('rePassword', 'compare', 'compareAttribute'=>'account_password', 'on' => 'register', 'message'=>'两次密码不同.'),
		array('verifyCode', 'captcha', 'on'=>'register', 'allowEmpty'=> !extension_loaded('gd')),
		
		array('account_name','unique'),
		array('account_name,account_password', 'required'),
		array('account_password,account_name,member_name', 'length', 'max'=>32,'min'=>6),
		array('email','email','message'=>'邮箱格式不正确'),
		PregRules::phoneRules('mobile'),
	),

	'relations' => array(
		'profile' => array(CActiveRecord::HAS_ONE, 'MemberProfile', 'id'),
	),
	
	'behaviors' => array(
		'userScope' => array(
			'class' => 'coms.behaviors.userScopes.DefaultScope',
			'relatedFields' => array(
				'uid',
			),
			'autoRun' => false,
		),
		'uidResolver' => array(
			'class' => 'coms.behaviors.AutoIdResolve',
		),
		'createTime' => array(
			'class' => 'lib.behaviors.auto.CCreateTime',
			'attribute' => 'create_time'
		),
	),
	'cascade' => array(
		'profile',
	),
	'_import' => array(
		array('*', 'models.ActiveRecord//*'),
	),
);